{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "fe105ef6-5264-4cb4-b467-60d9b0a337fd",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1 : a\n",
      "2 : b\n",
      "3 : c\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "((ii=1))\n",
    "(\n",
    "    cat <<EOF\n",
    "a\n",
    "b\n",
    "c\n",
    "EOF\n",
    ") | while read str ; do \n",
    "    echo \"$ii : $str\"\n",
    "    ((ii+=1))\n",
    "done"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "004e9622-e3a4-4780-816a-e5d1c77055b4",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "18\n"
     ]
    }
   ],
   "source": [
    "%%script bc\n",
    "7 + 11"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "a90b5943-54f0-4b12-b1b5-35d085a29bb2",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "19\n"
     ]
    }
   ],
   "source": [
    "%%sh\n",
    "X=19\n",
    "echo $X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "fdf96ecb-8342-479d-822b-ff9707977d9d",
   "metadata": {},
   "outputs": [
    {
     "ename": "ERROR",
     "evalue": "executing special commands in cell: \"%%sh\" can only appear at the start of the cell",
     "output_type": "error",
     "traceback": [
      "executing special commands in cell: \"%%sh\" can only appear at the start of the cell"
     ]
    }
   ],
   "source": [
    "X=17\n",
    "%%sh\n",
    "echo $X"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Go (gonb)",
   "language": "go",
   "name": "gonb"
  },
  "language_info": {
   "codemirror_mode": "",
   "file_extension": ".go",
   "mimetype": "text/x-go",
   "name": "go",
   "nbconvert_exporter": "",
   "pygments_lexer": "",
   "version": "go1.25.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
